<?php
class FlowerStarInfoVo extends SzAbstractMySqlVo
{

    private $userId;
    private $flower;
    private $temp;
    private $first;
    private $second;
    private $third;
    private $createTime;
    private $updateTime;

    /**
     * Initialize FlowerStarInfoVo.
     *
     * @param $userId
     * @param $flower
     * @param $temp
     * @param $first
     * @param $second
     * @param $third
     * @param $createTime
     * @param $updateTime
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return FlowerStarInfoVo
     */
    public function __construct($userId, $flower, $temp, $first, $second, $third, $createTime, $updateTime, $isInsert = false) {
        $this->userId = $userId;
        $this->flower = $flower;
        $this->temp = json_decode($temp, true);
        $this->first = json_decode($first, true);
        $this->second = json_decode($second, true);
        $this->third = json_decode($third, true);
        $this->createTime = $createTime;
        $this->updateTime = $updateTime;

        $this->isInsert = $isInsert;
        $this->voClassName = 'FlowerStarInfoVo';
        $this->ormName = 'FlowerStarInfo';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'flower' => $this->getFlower(),
            'temp' => ($needEncode) ? $this->getTemp() : $this->getRawTemp(),
            'first' => ($needEncode) ? $this->getFirst() : $this->getRawFirst(),
            'second' => ($needEncode) ? $this->getSecond() : $this->getRawSecond(),
            'third' => ($needEncode) ? $this->getThird() : $this->getRawThird(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'userId' => $this->getUserId(),
            'flower' => $this->getFlower(),
            'temp' => ($needEncode) ? $this->getTemp() : $this->getRawTemp(),
            'first' => ($needEncode) ? $this->getFirst() : $this->getRawFirst(),
            'second' => ($needEncode) ? $this->getSecond() : $this->getRawSecond(),
            'third' => ($needEncode) ? $this->getThird() : $this->getRawThird(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getUserId(),
            $this->getFlower(),
            $this->getTemp(),
            $this->getFirst(),
            $this->getSecond(),
            $this->getThird(),
            $this->getCreateTime(),
            $this->getUpdateTime(),
        );
    }

    public function getUserId()
    {
        return $this->userId;
    }

    public function setUserId($val)
    {
        $this->saveColumnStatus(0, $this->userId);
        $this->userId = $val;
    }

    public function getFlower()
    {
        return $this->flower;
    }

    public function setFlower($val)
    {
        $this->saveColumnStatus(1, $this->flower);
        $this->flower = $val;
    }

    public function getTemp()
    {
        return json_encode($this->temp);
    }

    public function getRawTemp()
    {
        return $this->temp;
    }

    public function setTemp($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[FlowerStarInfoVo] The length of column temp exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('FlowerStarInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[FlowerStarInfoVo] The length of column temp exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(2, $this->temp);
        $this->temp = $val;
    }

    public function getFirst()
    {
        return json_encode($this->first);
    }

    public function getRawFirst()
    {
        return $this->first;
    }

    public function setFirst($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[FlowerStarInfoVo] The length of column first exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('FlowerStarInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[FlowerStarInfoVo] The length of column first exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(3, $this->first);
        $this->first = $val;
    }

    public function getSecond()
    {
        return json_encode($this->second);
    }

    public function getRawSecond()
    {
        return $this->second;
    }

    public function setSecond($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[FlowerStarInfoVo] The length of column second exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('FlowerStarInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[FlowerStarInfoVo] The length of column second exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(4, $this->second);
        $this->second = $val;
    }

    public function getThird()
    {
        return json_encode($this->third);
    }

    public function getRawThird()
    {
        return $this->third;
    }

    public function setThird($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[FlowerStarInfoVo] The length of column third exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('FlowerStarInfoVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[FlowerStarInfoVo] The length of column third exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(5, $this->third);
        $this->third = $val;
    }

    public function getCreateTime()
    {
        return $this->createTime;
    }

    public function setCreateTime($val)
    {
        $this->saveColumnStatus(6, $this->createTime);
        $this->createTime = $val;
    }

    public function getUpdateTime()
    {
        return $this->updateTime;
    }

    public function setUpdateTime($val)
    {
        $this->saveColumnStatus(7, $this->updateTime);
        $this->updateTime = $val;
    }

}